function login(){
  var form = $('form');
  var formData = form.serialize();
  api.showProgress({
      style: 'default',
      animationType: 'fade',
      title: '努力加载中...',
      text: '先喝杯茶...',
      modal: false
  });

  $.ajax({
    url:URL+ 'login',
    type:'post',
    data:formData,
    dataType:'json',
    success:function(data){
        api.hideProgress();
        var result = eval("("+data+")");
        if(result.key){
          var user = JSON.stringify(result.val);
          localStorage.setItem("user",user);
          var user = localStorage.getItem("user");
          var u = eval("("+user+")");
          location.href="../html/home_win.html";

        }else {
          alert(result.msg);
        }
    },
    error: function(){
      api.hideProgress();
      alert("error");
    }
  });
}
